var express = require('express');
var swig = require('swig');
var app = express();
var port = process.env.PORT || 5030;

app.engine('html', swig.renderFile);

app.set('view engine', 'html');
app.set('views', __dirname);

app.set('view cache', false);
swig.setDefaults({ cache: false });

// app.use(function (req, res, next) {
//      console.log(req.url);
//      next();
// });

app.use(express.static(__dirname + '/dist'));

app.get('/', function (req, res) {


        res.render('index', {
                //obj: _obj
        });
});


app.use(function (req, res) {
        res.status(404).send('404 ?~T~Y误');
});

app.listen(port);
console.log('服务器已启动', port);